import React, { Component } from 'react'

 import {

    Modal,
    Form,
    Input
 } from 'antd'

 const Item = Form.Item

 class AddForm extends Component {
    componentWillMount(){
        this.props.setForm(this.props.form)
    }

    render() {
        const { getFieldDecorator } = this.props.form
        const {visible,onOk,onCancel} = this.props
        return (
            <div>
                < Modal 
                title="添加角色"
                visible={visible}
                onCancel={onCancel}
                onOk={onOk}
                
                >
                    <Form labelCol={{span:4}} wrapperCol={{span:14}}>
                    <Item label="添加角色">

                        {getFieldDecorator('roleName',{
                        rules:[{
                            required:true,
                            message:'商品名称必须输入'
                        }]
                        })( <Input placehold='商品名称必须输入' />)}

                    </Item>
                    </Form>
                </Modal>
            </div>
        )
    }
}

export default Form.create()(AddForm) 
